local skel = fk.CreateSkill {
  name = "emo__xinji",
  tags = {Skill.Wake}
}

Fk:loadTranslationTable{
  ["emo__xinji"] = "心悸",
  [":emo__xinji"] = "觉醒技，准备阶段，若你的体力值或手牌数小于2，则你摸两张牌，增加1点体力上限并回复1点体力，然后获得技能〖交流〗。",

  ["$emo__xinji1"] = "",
  ["$emo__xinji2"] = "",
}

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "big",
  can_trigger = function(self, event, target, player, data)
    return player:usedSkillTimes(skel.name, Player.HistoryGame) == 0
    and player:hasSkill(skel.name) and target == player and player.phase == Player.Start
  end,
  can_wake = function(self, event, target, player, data)
    return player:getHandcardNum() < 2 or player.hp < 2
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(2, skel.name)
    if player.dead then return end
    room:changeMaxHp(player, 1)
    if player.dead then return end
    room:recover { num = 1, skillName = skel.name, who = player, recoverBy = player }
    room:handleAddLoseSkills(player, "emo__jiaoliu")
  end,
})

return skel
